
#include <iostream>

#include "property.h"
#include "dynamic_property.h"

struct setport
{
    void operator()( const std::string & key, int port)
    {
        std::cout << "Key :"<<key;
        printf(" set port to %d\n",port);
    }
};


//void setport(int port)
//{
//        printf("set port to %d\n",port);
//}

using namespace vpm::utils;
int main(int argc, char * argv[])
{

//	std::cout << boost::is_integral<int>::value; 
//
//	Property<> p; 
//
//	p.set_property(std::string("socket_neagle"), true); 
//	p.set_property("teste", 2232); 
//	p.set_property("abc", "abcde"); 
//	p.set_property("abc",1);
//	std::cout << p.get_property<std::string>("abc")<<std::endl;
//
//	Property<unsigned char> ip; 
//
//	ip.set_property(24,"abc");
//	std::cout <<ip.get_property<std::string>(25) <<std::endl; 



	DynamicProperty<> dp ;
	dp.set_property<int>("port",8790,setport());
    std::cout <<"get port " << dp.get_property<int>("port")<<std::endl;
	dp.set_property("port",8999);
    std::cout <<"get port " << dp.get_property<int>("port")<<std::endl;


	DynamicProperty<unsigned char> ip; 

	ip.set_property(24,"abc");
	std::cout <<ip.get_property<std::string>(25) <<std::endl; 

	return 0; 
}
